package leecode

import "sort"

func maximizeSum(nums []int, k int) (result int) {
	for i := 1; i <= k; i++ {
		sort.Ints(nums)
		result += nums[len(nums)-1]
		nums[len(nums)-1]++
	}
	return result
}
